package com.chen.service.role;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chen.dao.role.RoleDao;
import com.chen.pojo.Role;
@Service("roleService")
public class RoleServiceImpl implements RoleService{
	@Autowired
	private RoleDao roleDao;
	@Override
	public List<Role> getRoleList() throws Exception {
		return roleDao.getRoleList();
	}
	@Override
	public boolean addRole(Role role) throws Exception {
		return roleDao.addRole(role) > 0;
	}
	@Override
	public boolean updateRole(Role role) throws Exception {
		return roleDao.updateRole(role) > 0;
	}
	@Override
	public boolean deleteRole(String delId) throws Exception {
		return roleDao.deleteRole(delId) > 0;
	}
	@Override
	public Role queryRole(String roleCode) throws Exception {
		return roleDao.getRole(roleCode);
	}
	@Override
	public Role getRoleById(String id) throws Exception {
		return roleDao.getRoleById(id);
	}
	
}
